home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / gravity.swf / scripts / frame_103 / PlaceObject2_196_35 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2007-03-28  |  775 b   |  27 lines

  1. onClipEvent(enterFrame){
  2.    function trim(theNumber, decPlaces)
  3.    {
  4.       if(decPlaces >= 0)
  5.       {
  6.          var temp = Math.pow(10,decPlaces);
  7.          return Math.round(theNumber * temp) / temp;
  8.       }
  9.    }
  10.    distance = int(Math.sqrt(Math.pow(_parent.lander._x - _parent.foreground._x,2) + Math.pow(_parent.lander._y - _parent.foreground._y,2)) - 709);
  11.    if(go != "stop" && myTime != 0)
  12.    {
  13.       timer = myTime - trim((getTimer() - myTimerStart) / 1000,2);
  14.       if(0 >= timer)
  15.       {
  16.          _parent.popup.gotoAndStop("notime");
  17.          _parent.lander.myLanded = "stop";
  18.          go = "stop";
  19.       }
  20.    }
  21.    if(-10 >= _parent.Angry.distance)
  22.    {
  23.       _parent.lander.exploding = "true";
  24.       _parent.lander.myLanded = "blow";
  25.    }
  26. }
  27.